import axios from 'axios';

///////////////////////档案室内////////////////////////////////
// 档案室列表
export function getCrdaList(data: any) {
  return axios.get('/room/index', {
    params: data,
  });
}

// 获取档案室资料;
export function getCrdaDetail(data: any) {
  return axios.get('/room/detail', {
    params: data,
  });
}

// 修改档案室
export function editCrdaDetail(data: any) {
  return axios.post('/room/edit', data);
}

// 新增档案室
export function addCrda(data: any) {
  return axios.post('/room/add', data);
}

// 删除档案室
export function delectCrda(data: any) {
  return axios.post('/room/delete', data);
}

///////////////////////档案柜/////////////////////////////////

// 档案柜列表
export function getCabinetList(data: any) {
  return axios.get('/cabinet/index', {
    params: data,
  });
}

// 获取档案柜资料;
export function getCabinetaDetail(data: any) {
  return axios.get('/cabinet/detail', {
    params: data,
  });
}

// 修改档案柜
export function editCabinet(data: any) {
  return axios.post('/cabinet/edit', data);
}

// 新增档案柜
export function addCabinet(data: any) {
  return axios.post('/cabinet/add', data);
}

// 删除档案柜
export function delectCabinet(data: any) {
  return axios.post('/cabinet/delete', data);
}

///////////////////////档案类型/////////////////////////////////
// 档案柜类型
export function getCabinetType(data: any) {
  return axios.get('/cabinet_type/index', {
    params: data,
  });
}
// 档案柜详情
export function getCabinetTypeDetail(data: any) {
  return axios.get('/cabinet_type/detail', {
    params: data,
  });
}
// 添加档案室类型
export function addcabinetType(data: any) {
  return axios.post('/cabinet_type/add', data);
}
// 编辑档案室类型
export function editcabinetType(data: any) {
  return axios.post('/cabinet_type/edit', data);
}
// 删除档案室类型
export function deletecabinetType(data: any) {
  return axios.post('/cabinet_type/delete', data);
}

// 档案相关
// 档案列表
export function getarchiveList(data: any) {
  return axios.get('/archive/index', {
    params: data,
  });
}
// 获取档案详情
export function getCabinetDetail(data: any) {
  return axios.get('/archive/detail', {
    params: data,
  });
}
// 添加档案室
export function addarch(data: any) {
  return axios.post('/archive/add', data);
}
// 编辑档案室
export function editarch(data: any) {
  return axios.post('/archive/edit', data);
} // 删除档案室
export function deletearch(data: any) {
  return axios.post('/archive/delete', data);
}
///////////////////////档案借阅/////////////////////////////////
// 借阅档案列表
export function getBorrowList(data: any) {
  return axios.get('/borrow/index', {
    params: data,
  });
}
// 借阅档案详情
export function getBorrowDetail(data: any) {
  return axios.get('/borrow/detail', {
    params: data,
  });
}
// 借阅档案添加
export function addBrrow(data: any) {
  return axios.post('/borrow/add', data);
}
// 借阅档案编辑
export function editBrrow(data: any) {
  return axios.post('/borrow/edit', data);
}
// 借阅档案删除
export function deleteBorrow(data: any) {
  return axios.post('/borrow/delete', data);
}

//档案统计相关
// 饼状图
export function getCounteip(data: any) {
  return axios.get('/archive_statistics/pie', {
    params: data,
  });
}
// 柱状图
export function getCountAbr(data: any) {
  return axios.get('/archive_statistics/bar', {
    params: data,
  });
}

// 存取档案记录
export function getcabinetOpen(data: any) {
  return axios.get('/cabinet_open/index', {
    params: data,
  });
}
// 存取档案动作
export function openCabinet(data: any) {
  return axios.post('/archive/open', data);
}
